package com.buaa.repository.solr;

import com.buaa.model.solr.Paper;
import org.springframework.data.domain.Pageable;
import org.springframework.data.solr.repository.Query;
import org.springframework.data.solr.repository.SolrCrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by DELL on 2018/4/9.
 */
@Repository
public interface PaperSolrRepository extends SolrCrudRepository<Paper,String> {

    @Query("author_cn_ss:*?0*")
    List<Paper> findPaperListByAuthor(String author, Pageable pageable);

    @Query("author_cn_ss:*?0* AND organizations_simple_cn_ss:*?1*")
    List<Paper> findPaperListByAuthorAndOrg(String author,String organization,Pageable pageable);

    @Query("keywords_cn_ss:*?0*")
    List<Paper> findPaperListByKeyword(String keyword, Pageable pageable);
}
